const { rejects } = require('assert')

async function fn2() {
  try {
    fn3()
  } catch (err) {
    console.log(err, 'liu')
  }
}

async function fn3() {
  // await setTimeout(function () {
  //   throw new Error('error111')
  // }, 1000)

  return new Promise((resolve, reject) => {
    setTimeout(function () {
      const r = Math.random()
      if (r < 0.5) {
        reject('error async')
      }
    })
  })
}

console.log(fn2())
